40923107 cp2020

  • Home
    • Site Map
    • reveal
    • blog
  • About
    • Develop
  • Website
  • HW1
    • Pc Hardware
      • PCH 4 Cases, Form Factors, and Power Supplies(外殼,外形尺寸和電源)(P.37~P.41)
      • Computer Cases 電腦機箱 (P.38)
      • Power Supplies 電源 (P.39)
      • Power Supply Connectors 電源連接器(P.40)
      • Remove A Power Supply 卸下電源(P.41)
      • PCH 5 Motherboards, Expansion Buses, and Processors (主板,擴展總線和處理器)(P.42~47)
      • Motherboards and Components 主板和組件 (P.43)
      • Expansion Slots 擴展插槽 (P.44)
      • Jumpers 跳線 (P.45)
      • Processor History 處理器歷史 (P.46)
      • Virtualization 虛擬化 (P.47)
      • CPU Cooling (CPU散熱) (P.48)
  • HW2
  • HW3
    • 10:List Overlap Comprehensions  列表重疊理解
    • 11:Check Primality Functions 檢查基本功能
    • 12:List Ends 清單結尾
11:Check Primality Functions 檢查基本功能 << Previous

12:List Ends 清單結尾

Exercise 12 (and Solution) 練習12(和解決方案)

Write a program that takes a list of numbers (for example, a = [5, 10, 15, 20, 25]) and makes a new list of only the first and last elements of the given list. For practice, write this code inside a function.

編寫一個程序,該程序接受一個數字列表(例如,a = [5、10、15、20、25]),並僅給出給定列表的第一個和最後一個元素組成一個新列表。 為了練習,請在函數內編寫此代碼。

Concepts to practice 練習概念

• Lists and properties of lists

   列表和列表屬性

• List comprehensions (maybe)

   列表理解(也許)

• Functions

   職能

Happy coding! 祝您編碼愉快!


11:Check Primality Functions 檢查基本功能 << Previous

Copyright © All rights reserved | This template is made with by Colorlib